import Suggestion from '../components/suggestion';
import * as DevTeamAction from 'actions/dev-team';
import * as ReactRedux from 'react-redux';

const mapStateToProps = (state) => {
  return {
    options: state.suggestDevTeam.map(devTeam => {
      return {
        value: devTeam.id,
        text: devTeam.name
      };
    }),
    placeholder: '输入开发组名称来查找开发组'
  };
};

const mapDispatchToProps = (dispatch) => {
  return {
    onSuggest: (value) => {
      return dispatch(DevTeamAction.suggest(value));
    }
  };
};

export default ReactRedux.connect(mapStateToProps, mapDispatchToProps)(Suggestion);
